<?php
header ("Content-Type:text/html; charset= utf-8");
require_once ('config.php');
require_once (WEBURL.'/login_status_check.php');
if(!checkLogin()){
	$gotopage=base64_encode("work_climate_set.php");
	header("Location:admin_login.php?gotopage=".$gotopage);
}
else{
	$_SESSION['file_upload_allowed']="allowed";
	
	if(empty($_GET['type']))
	{
		echo "forbidden:cann't find type!";
	
	}
	else
{
		
	
	switch ($_GET['type'])
	{
		case 'leadership':
		$smarty->assign("title","设定领导班子");
		break;
		case 'organization':
		$smarty->assign("title","设定内设机构");
		break;
		case 'profile':
		$smarty->assign("title","单位简介");
		break;
		case 'tel':
		$smarty->assign("title","办公室电话");
		break;
		case 'recruit':
		$smarty->assign("title","人员招聘");
		break;
		case 'special':
		$smarty->assign("title","特色作物");
		break;
		case 'climate':
		$smarty->assign("title","气候特点");
		break;
		case 'crops':
		$smarty->assign("title","农作物分布");
		break;
		default:
		echo "forbidden:cann't find type!";
		exit();	
	}
	
	$smarty->assign("type",$_GET['type']);
	$filename=WEBURL."/data/default/".$_GET['type'].".txt";
	
	if(!file_exists($filename))
	{
		$filename=WEBURL."/data/default/Leadership.txt";
	}
	
	
	
	$info=file_get_contents($filename);
	$smarty->assign("info",$info);
	$smarty->display("default_page_set.htm",md5("work_climate_set.php"));
	

}
	
	
}
